<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="付款记录 | 网络下单系统 | ${clieUser.clie.estName}" />
<%@ include file="../inc/OnlineTitle.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/css/Query.css" rel="stylesheet" type="text/css">
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function checkDateStr(){
		var startDate=document.getElementById("start_date").value;
		if(startDate!=null && startDate!=''){
			var arr=startDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','开始日期格式不正确',200,100);
				return false;
			}
		}
		var endDate=document.getElementById("end_date").value;
		if(endDate!=null && endDate!=''){
			var arr=endDate.split("-");
			if(arr.length==null || arr.length!=3){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}else if(isNaN(arr[0]) || isNaN(arr[1]) || isNaN(arr[2])){
				ShowAlert('提示框','结束日期格式不正确',200,100);
				return false;
			}
		}
		return true;
	}
	function doSearch(){
		if(checkDateStr()){
			var startDate=document.getElementById("start_date").value;
			var endDate=document.getElementById("end_date").value;
			window.location="/online/PayList.ihtm?start_date="+startDate+"&end_date="+endDate;
		}
	}
	function doGo(pageIndex){
		window.location="/online/PayList.ihtm?start_date=${startDate}&end_date=${endDate}&current_page="+pageIndex;
	}
	function doJump(pageIndex){
		if(window.event.keyCode==13){
			doGo(pageIndex);
		}
	}
	function DoubleClick(it){
	}
	function doCancel(){
		window.close();
	}
	function doInit(){
		//Window_Onload();
	}
	function checkInput(){
		if(window.event.keyCode==13){
			doSearch();
		}
	}
	function setDate(type){
		var d=new Date();
		var startStr="";
		var endStr="";
		if(type=="CURRENT_MONTH"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-01";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="PREVIEW_MONTH"){
			d=new Date(d.getFullYear(),d.getMonth(),1);
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-1";
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="TODAY"){
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}else if(type=="YESTERDAY"){
			d.setDate(d.getDate()-1);
			startStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
			endStr=d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		}
		document.getElementById("start_date").value=startStr;
		document.getElementById("end_date").value=endStr;
	}
</script>
</head>
<body oncontextmenu="return false" onLoad="doInit();" class="sheet" style="padding-top:10px;text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>付款记录</h2>
      <p>查询指定日期范围内的付款记录</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
      <div class="content">
        <table width="100%">
          <tbody>
            <tr>
              <td  align="right">
              	日期
              	<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" id="start_date" name="start_date" value="<c:out value="${startDate}" />">
            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('start_date'),'yyyy-mm-dd',this,false,'');">
            	至
            	<input type="text" class="TextBox Datetime" maxlength="15" onKeyUp="checkInput();" id="end_date" name="end_date" value="<c:out value="${endDate}" />">
            	<img src="/images/calendar.gif" class="imgIconButton" onClick="displayCalendar(document.getElementById('end_date'),'yyyy-mm-dd',this,false,'');">
            	<a href="javascript:setDate('CURRENT_MONTH');">本月</a>
				<a href="javascript:setDate('TODAY');">今天</a>
				<a href="javascript:setDate('YESTERDAY');">昨天</a>
				<a href="javascript:setDate('PREVIEW_MONTH');">上月</a>
	            <input type="button" class="buttom search-but" value=" 查 询" onClick="doSearch();">
			  </td>
            </tr>    
           </tbody>      
        </table>
      </div>
	  <%@include file="../inc/AlertMsg.jsp"%>
	  
	  <div class="cue-info">
      	<span>金额合计：${costTotal}元</span>
	  </div>
	  
	  <div class="table-list">
		<table width="100%">      
			<tr >
				<th  width="12%">日期</th>
				<th  width="38%">摘要</th>
				<th  width="30%">银行账户</th>
				<th  width="20%">金额</th>
			</tr>
			<c:forEach var="item" items="${qr.list}" varStatus="i">
				<c:if test="${(i.index mod 2)==0}"><c:set var="trClass" value="query_list_data_tr1" /></c:if>
				<c:if test="${(i.index mod 2)!=0}"><c:set var="trClass" value="query_list_data_tr2" /></c:if>
				<tr class="${trClass}" index="${i.index+1}" style='cursor:pointer;' ondblclick='javascript:DoubleClick(this)' onClick='javascript:ClickCheck(this)' onmouseout='javascript:mouseout(this)' onmouseover='javascript:mouseover(this)'>
					<td>
						<input type="radio" name='query_checkbox' value="${i.index}" style="display:none">
						<fmt:formatDate value="${item[0]}" pattern="yyyy-MM-dd"/>
					</td>
					<td>${item[1]}</td>
					<td><commonTag:showSimpleObjectName list="${baList}" objectId="${item[2]}" /></td>
					<td>${item[3]}</td>
				</tr>
			</c:forEach>
		</table>
		<%@include file="../inc/Pages.jsp"%>
      </div>     
    </div>
  </div>
</div>
</body>
</html>